package entity

type Product struct {
	Id           int64   `gorm:"column:id;primary_key" json:"id"`
	Name         string  `gorm:"column:name;type:varchar(255);not null" json:"name"`
	CategoryId   int64   `gorm:"column:category_id;type:bigint;not null" json:"category_id"`
	ProductType  int     `gorm:"column:product_type;type:integer;not null" json:"product_type"`
	Description  string  `gorm:"column:description;type:varchar(255);not null" json:"description"`
	Price        float64 `gorm:"column:price;type:double;not null" json:"price"`
	Stock        int     `gorm:"column:stock;type:integer;not null" json:"stock"`
	Status       string  `gorm:"column:status;type:varchar(255);not null" json:"status"`
	ImageURL     string  `gorm:"column:image_url;type:varchar(255);not null" json:"image_url"`
	ExtraContext string  `gorm:"column:extra_context;type:varchar(255);not null" json:"extra_context"`
	CreatedAt    int64   `gorm:"column:created_at;type:bigint;not null" json:"created_at"`
	UpdatedAt    int64   `gorm:"column:updated_at;type:bigint;not null" json:"updated_at"`
}

func (p *Product) TableName() string {
	return "products"
}
